package gamagora.game.entity
{
	import Box2D.Dynamics.b2Body;
	
	import gamagora.game.resources.OSImages;

	public class OSFireGround extends OSBox
	{
		//Dépend de l'image de feu -> voir graphiste
		private static const WIDTH:Number = 200;
		private static const HEIGHT:Number = 20;
		
		private var _image:OSEntity;
		private var _blurEffect:OSBlurEffect;
		
		public function OSFireGround(X:Number=0, Y:Number=0, color:uint = 0xff000000)
		{
			super(FIRE_GROUND, X, Y, WIDTH, HEIGHT);
			makeGraphic(WIDTH, HEIGHT, color);
			
			//Physique
			_bodyDef.type = b2Body.b2_staticBody;
			_bodyDef.angle = angle * (Math.PI / 180);
			_fixDef.friction = 0;
			_fixDef.density = 0;
			_fixDef.restitution = 0;
						
			//Image de fond en premier
			_image = new OSEntity(NOTHING, x, y - HEIGHT, OSImages.FIRE);
			add(_image);
			
			//Système de flou 
			_blurEffect = new OSBlurEffect(x, y - 10, WIDTH, 1);
			_blurEffect.setXSpeed(-5, 5);
			_blurEffect.setYSpeed( -20, -60);
			_blurEffect.effectBlobHeight = 10;
			_blurEffect.effectBlobWidth = 6;
			_blurEffect.effectDisplaceAmtX = 2;
			_blurEffect.effectDisplaceAmtY = 3;
			_blurEffect.effectAlpha = .6;
			_blurEffect.effectLife = 0.5;
			_blurEffect.effectBlobCount = 80;
			add(_blurEffect);
		}
	}
}
